<?php
/* @var $this TurmaHasAlunoController */
/* @var $model TurmaHasAluno */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'turma-has-aluno-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<div>
		<?php 
		$funcionarios = Funcionario::model()->findAllByAttributes(array('polo_id' => Yii::app()->session['polo_id']));
		$data = array();
		foreach ($funcionarios as $funcionario) {
			$pessoa = Pessoa::model()->findByAttributes(array('id'=>$funcionario->pessoa_id));
			if($funcionario->id != 1) {
				$data[$funcionario->id] = $pessoa->nome;
			}
		} ?> <?php echo $form->labelEx($model,'responsavel_id'); ?> <?php echo $form->dropDownList($model, 'responsavel_id', $data, array('class'=>'span5','empty' => '')); ?>
		
		<?php echo $form->error($model,'responsavel_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->